package com.specificgroup.jira.plugin.acpro.service;

import com.specificgroup.jira.plugin.acpro.mapping.*;
import com.specificgroup.jira.plugin.acpro.model.DownloadedAttachment;
import com.specificgroup.jira.plugin.acpro.model.Settings;
import com.specificgroup.jira.plugin.acpro.model.jira.JiraImportData;
import com.specificgroup.jira.plugin.acpro.model.jira.JiraIssueData;
import com.specificgroup.jira.plugin.acpro.model.jira.JiraProject;
import com.specificgroup.jira.plugin.acpro.model.jira.JiraProjectComponent;
import com.specificgroup.jira.plugin.acpro.exception.AcproException;
import com.specificgroup.jira.plugin.acpro.sync.Sync;

import java.util.List;
import java.util.Map;

/**
 *
 * @author Ivan Holub
 */
public interface JiraAcproPluginJiraManager {

    Map<String, JiraUser> getJiraUsersMap(); // userName -> user

    List<JiraStatus> getJiraStatuses();

    Map<String, JiraStatus> getJiraStatusesMap();

    List<JiraProject> getJiraProjects();

    List<JiraProjectComponent> getJiraProjectComponents(Long projectId);

    List<JiraIssueType> getJiraIssueTypes();

    Map<String, JiraIssueType> getJiraIssueTypesMap(); //id -> issueType

    List<JiraUser> getAllJiraUsers();

    List<JiraPriority> getJiraPriorities();

    Map<String, JiraPriority> getJiraPrioritiesMap();

    List<JiraProjectVersion> getJiraProjectVersions(Long projectId);

    Map<Long, JiraProjectVersion> getJiraProjectVersionsMap(Long projectId);

    void createIssue(Sync sync, JiraImportData jiraImportData, JiraIssueData data, Map<String, Map<String, DownloadedAttachment>> downloadedAttachments);

    boolean isAcproItemNumberCustomFieldExists();

    void createAcproItemNumberCustomField();

    void validateJiraStatus(String statusId, Long jiraProjectId, String issueTypeId) throws AcproException;

    Map<String, JiraResolution> getJiraResolutionMap();

    List<JiraResolution> getJiraResolutions();
}
